package com.weike.common.utils;

import lombok.Data;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

/**
 * @ClassName: Local
 * @Author: YuanDing
 * @Date: 2024/4/27 18:06
 * @Description:
 */

@Component
public class Local extends ThreadLocal{

    private final ThreadLocal<String> threadLocal = new ThreadLocal<>();

    private String currentUserId;


    public String getCurrentUserId() {
       return threadLocal.get();
    }

    public void setCurrentUserId(String id) {
        threadLocal.set(id);
    }
}
